//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package cn.ty.jpa.wrapper;

/**
 * @author summit
 * @since 2021/07/04
 */
public class OperatorWrapper {
    private SpecificationWrapper<?> specWrapper;
    private String name;
    private Object value;

	public <Y extends Comparable<? super Y>> Y getCompareValue(){
		return (Y)value;
	}

    public OperatorWrapper() {
    }

    public SpecificationWrapper<?> getSpecWrapper() {
        return this.specWrapper;
    }

    public String getName() {
        return this.name;
    }

    public Object getValue() {
        return this.value;
    }

    public void setSpecWrapper(final SpecificationWrapper<?> specWrapper) {
        this.specWrapper = specWrapper;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setValue(final Object value) {
        this.value = value;
    }



    protected boolean canEqual(final Object other) {
        return other instanceof OperatorWrapper;
    }

	@Override
	public boolean equals(Object o) {
		if (this == o) {return true;}
		if (o == null || getClass() != o.getClass()) {return false;}

		OperatorWrapper that = (OperatorWrapper) o;

		if (specWrapper != null ? !specWrapper.equals(that.specWrapper) : that.specWrapper != null)
		{return false;}
		if (name != null ? !name.equals(that.name) : that.name != null) return false;
		return value != null ? value.equals(that.value) : that.value == null;
	}

	@Override
	public int hashCode() {
		int result = specWrapper != null ? specWrapper.hashCode() : 0;
		result = 31 * result + (name != null ? name.hashCode() : 0);
		result = 31 * result + (value != null ? value.hashCode() : 0);
		return result;
	}

	@Override
	public String toString() {
        return "OperatorWrapper(specWrapper=" + this.getSpecWrapper() + ", name=" + this.getName() + ", value=" + this.getValue() + ")";
    }
}
